//
//  LLShoppingCartFooter.m
//  LoveLove
//
//  Created by 肖兰月 on 2019/4/9.
//  Copyright © 2019 wkf. All rights reserved.
//

#import "LLShoppingCartFooter.h"
#import "LLShoppingCartModel.h"

@interface LLShoppingCartFooter ()
@property (strong, nonatomic) UILabel *activityTitleLbl;
@property (strong, nonatomic) UILabel *activityLbl;
@end

@implementation LLShoppingCartFooter

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self initSubViews];
    }
    return self;
}

- (void)initSubViews {
    UIView *bgView = UIView.new;
    bgView.frame = CGRectMake(10, 0, LLScreenWidth-20, self.height-5);
    bgView.backgroundColor = UIColor.whiteColor;
    [bgView.layer addMaskWithRoundedRect:bgView.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(13, 13)];
    [self addSubview:bgView];
    
    _activityTitleLbl = [LLInitBaseViewTool labelWithText:@"本店活动" textColor:LLColor(230, 0, 18) font:10 textAlignment:NSTextAlignmentCenter];
    _activityTitleLbl.frame = CGRectMake(40, (self.height-10-15)/2.0, 50, 15);
    _activityTitleLbl.layer.borderColor = LLColor(225, 0, 0).CGColor;
    _activityTitleLbl.layer.borderWidth = 1;
    _activityTitleLbl.layer.cornerRadius = 3;
    _activityTitleLbl.clipsToBounds = YES;
    [bgView addSubview:_activityTitleLbl];
    
    _activityLbl = [LLInitBaseViewTool labelWithText:nil textColor:LLColorRGB(0) font:13 textAlignment:NSTextAlignmentLeft];
    _activityLbl.frame = CGRectMake(_activityTitleLbl.right+10, 0, bgView.width-_activityTitleLbl.right-10, self.height-10);
    [bgView addSubview:_activityLbl];
}

- (void)setModel:(LLShoppingCartSectionModel *)model {
    _model = model;
    _activityLbl.text = model.noteStr;
}

@end
